<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>职位管理</title>
<link href="<c:url value='/insdep/reset.min.css' />" rel="stylesheet" type="text/css">
<link href="<c:url value='/insdep/easyui_full.css'/>" rel="stylesheet" type="text/css">
<link href="<c:url value='/insdep/icon.css'/>" rel="stylesheet" type="text/css">
<script type="text/javascript" src="<c:url value='/insdep/jquery-1.11.3.min.js'/>"></script>
<script type="text/javascript" src="<c:url value='/insdep/jquery.easyui-1.5.2.min.js'/>"></script>
<script type="text/javascript" src="<c:url value='/insdep/insdep-extend.min.js'/>"></script>

<link href="<c:url value='/css/wsf-button.css'/>" rel="stylesheet" type="text/css">
</head>
<body> 
	<script type="text/javascript">
		$(function(){
			//重置
			/* $("#reset").linkbutton({
				onClick:function(){
					$("#position_search_from").form('reset');
					$("#position_info_dg").datagrid('load');
				}
			}); */
			//刷新
			$("#positioninfo_refresh").linkbutton({
				onClick:function(){
					$("#position_info_dg").datagrid('load');
				}
			});
			//根据部门id查询职位
			$("#position_info_dg").datagrid({
					onBeforeLoad:function(param){
						param.deptid=$("#dept_position_manager_win").window("options").deptid;
					}
			});
			//新增职位
			$("#create_new_postition").linkbutton({
				onClick:function(){
					$("#position_info_win").window({
					      width: 400,
				          height: 370,
				          title: '新建职位窗口',
				          iconCls: 'icon-update',
				          modal: true,//表示模式窗口
				          maximizable:false,
				          minimizable:false,
				          collapsible:false,
				          draggable: false ,
						  href:'to_CreatePosition',//请求远程数据
						  onLoad : function() {
							//初始化表单
							$('#create_position').form('load',{
								positionId:0,
								positionName:'',
								positionLevel:'5',
								positionDesc:'',
								positionOrgan:'',
								superPosition:''
						    	});
							 //初始化combobox
							 $("#superPosition")
							 $("#positionLevel")
							} 
						});
				}
			});
			
			
		});
	</script>
	<script type="text/javascript">
		/**
		 *操作
		 */
		/* function position_action(){
			var remove = "", edit = "";
			remove = "<a href='#' class='action_button'>删除<a/>";
			edit = "<a href=''#' class='action_button'>编辑<a/>";
			return remove+edit; 
		} */
	</script>
	<div class="easyui-layout" data-options="fit:true">
    <!-- 数据表格  --> 
    <div data-options="region:'center',border:false" style="border-top: 1px solid #D3D3D3">
		<table id="position_info_dg" class="easyui-datagrid" 
		data-options="
		fit:true,
		fitColumns:true,
		rownumbers: true,
		url:'find_PositionByDeptId',
		toolbar: '#position_tb',
		nowrap:false, 
		autoRowHeight:true,
		autoRowWidth:300,
		pagination:true,
		pageSize: 2,
		pageList:[2,4,6,8]">
		<thead>
			<tr>
				<th data-options="field:'superPositionId', align:'center',hidden:true">上级职位编号</th>
				<th style="width:10%;" data-options="field:'positionId', align:'center',sortable:true">职位编号</th>
				<th style="width:10%;" data-options="field:'positionName', align:'center'">职位名称</th>
				<th style="width:10%;" data-options="field:'positionLevel', align:'center'">职位等级</th>
				<th style="width:10%;" data-options="field:'positionDesc', align:'center'">职位详情</th>
				<th style="width:10%;" data-options="field:'positionOrgan', align:'center'">职位编制</th>
				<th style="width:10%;" data-options="field:'positionNumber', align:'center'">在职人数</th>
				<th style="width:10%;" data-options="field:'superPosition', align:'center'">上级职位</th>
				<th style="width:30%;" data-options="field:'teste', align:'center', formatter:position_action">操作</th>
			</tr>
		</thead>
		</table>
    </div>
    </div> 
    
    
    
    <!--easyui-datagrid当中的工具栏  -->
    <div id="position_tb">
    		<a id="create_new_postition" class="easyui-linkbutton" data-options="iconCls:'icon-add'">创建</a>
    		<a id="positioninfo_refresh" class="easyui-linkbutton" data-options="iconCls:'icon-reload'">刷新</a>
    </div>  
 
	<!--点击工具栏弹出的window -->
	<div id="position_info_win"></div>
	
</body>
</html>